package unit10;

import java.awt.*;
import javax.swing.*;

public class Ex10_4_GridLayoutTest extends JFrame {
    public Ex10_4_GridLayoutTest() {
        Container container = getContentPane();
        container.setLayout(new GridLayout(4, 3, 5, 5));
        for (int i = 1; i <= 10; i++)
            container.add(new JButton("Component " + i));
    }

    public static void main(String[] args) {
        Ex10_4_GridLayoutTest frame = new Ex10_4_GridLayoutTest();
        frame.setTitle("Show GridLayout");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(200, 200);
        frame.setVisible(true);
    }
}
